package com.jie.langlangmall.service.impl;

import com.jie.langlangmall.mapper.UmsResourceCategoryMapper;
import com.jie.langlangmall.model.UmsResourceCategory;
import com.jie.langlangmall.model.UmsResourceCategoryExample;
import com.jie.langlangmall.service.UmsResourceCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author Jie
 * @Date 2024/11/22 16:35
 * @Email 3217998214@qq.com
 * @Description 后台资源分类管理
 */
@Service
public class UmsResourceCategoryServiceImpl implements UmsResourceCategoryService {

    @Autowired
    private UmsResourceCategoryMapper resourceCategoryMapper;

    /**
     * 查询所有资源分类
     *
     * @return
     */
    @Override
    public List<UmsResourceCategory> listAll() {
        // select * from ums_resource_category order by sort desc
        UmsResourceCategoryExample example = new UmsResourceCategoryExample();
        example.setOrderByClause("sort desc");
        return resourceCategoryMapper.selectByExample(example);
    }
}
